﻿using System;
using IkeCode.WP7.HQReader.Model;
using System.Collections.Generic;
using IkeCode.WP7.HQReader.Interfaces;

namespace IkeCode.WP7.HQReader.Services.Design
{
    /// <summary>
    /// 
    /// </summary>
    public class DesignFeedPublisherDataService : IFeedPublisherDataService
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="callback"></param>
        public void GetPublishers(Action<List<IIcFeedPublisher>, Exception> callback)
        {
            var item1 = new IcFeedPublisherModel(new Uri("http://vidadeprogramador.com.br/feed/"), "Vida de Programador", 5);
            var item2 = new IcFeedPublisherModel(new Uri("http://blog.drpepper.com.br/?feed=rss2"), "DDDD. Pepper", 10);
            var item3 = new IcFeedPublisherModel(new Uri("http://blog.drpepper.com.br/?feed=rss2"), "CCCC. Pepper", 2);
            var item4 = new IcFeedPublisherModel(new Uri("http://blog.drpepper.com.br/?feed=rss2"), "BBBB. Pepper", 4);
            var item5 = new IcFeedPublisherModel(new Uri("http://blog.drpepper.com.br/?feed=rss2"), "AAAA. Pepper", 26);
            var result = new List<IIcFeedPublisher>(2) { item1, item2, item3, item4, item5 };

            callback(result, null);
        }
        
        /// <summary>
        /// 
        /// </summary>
        /// <param name="publisher"></param>
        /// <param name="callback"></param>
        public void PostPublisher(IIcFeedPublisher publisher, Action<IIcFeedPublisher, Exception> callback)
        {
            callback(null, null);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="publisher"></param>
        /// <param name="callback"></param>
        /// <param name="showConfirmation">Show confirmation message flag</param>
        public void DeletePublisher(IIcFeedPublisher publisher, Action<bool, Exception> callback, bool showConfirmation = false)
        {
            callback(true, null);
        }
    }
}